import { notFound } from "next/navigation";
import { getMyPostById } from "./actions";
import EditorArea from "./editor-area";

export default async function Page({ params: { postId } }: { params: { postId: string } }) {
  const $post = await getMyPostById(postId);
  if (!$post.ok || !$post.data) {
    notFound();
  }
  const post = $post.data;

  return (
    <div>
      修改： {postId}
      <div>
        <EditorArea post={post} />
      </div>
    </div>
  );
}
